import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 查询税率
// export const queryTex = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partInfos/parms`, { params });
export const queryTex = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/params/getParaValue?module=SPA&para=BJCGSL`);
// 获取默认经销商
export const queryDefaultDealer = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/params/getParaValue?module=SPA&para=DZJJXS`);

// 查询借进入库借件数量
export const queryBorrowPartCount = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/params/getParaValue?module=SPA&para=JJSL`);

// 根据仓库备件代码查询备件是否存在
export const queryParyHasStorageById = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partbuy/getStorageByPartNo`, {
    params
  });

// 获取所有品牌
export const getBrandAll = params => axios.get(`${SERVER.DMSCLOUD_SYSBASEDATA}/basedata/vehicleProduct/brandsqueryall`, {});
// 获取所有品牌
export const getBrand = params =>
  axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/BasicParametersAfterSales/brandsdict2`, {
    params
  });
// 获取包装单位
export const queryPackUnit = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partInfos/partGroupCode`, {});

// 查询所有员工
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);

// 获取仓库信息(根据权限)
export const getStorageList = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/findUserControlStorageCode`, {
    params
  });

// 获取备件入库排序打印参数 选中为0 不选中为1
export const queryPartinventoryPrintParam = params =>
  axios.get(`${SERVER.DMSCLOUD_BASEDATA}/params/getSysParaValue?module=SPA&para=BJRKDSJ`, {
    params
  });

// 获取模块公共参数
export const querySysParam = (module, para) => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/params/getSysParaValue?module=${module}&para=${para}`);

// 根据公司id获取公司信息 owenrCode
export const queryCompanyInforById = params =>
  axios.get(`${SERVER.DMSCLOUD_BASEDATA}/dealerInfo/getDataByOwenrCode`, {
    params
  });

// 查询所有订单类型
export const queryAllOrderTypeInfo = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/partPurchase/getCheckRule`, {
    params
  });
// 查询库位信息
export const queryControlLocations = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partmanage/locations`, { params });

// 导出库存信息
export const exportData = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/partmanage/export`, { params, responseType: 'blob' });
